#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <queue>
using namespace std;
/*
const int maxn = 10000 + 1, maxk = 1000;
int l,d;
int a[maxn][maxk] = {0};
int pn[maxn]={0};
int s[maxn] = {0};
int num[maxn] = {0};

int main()
{
	freopen("divisors.in","r",stdin);
	freopen("divisors.out","w",stdout);
	int i,j;

	cin >> l >> d;
	s = 0;
	n = 0;
	a[0][0] = 1;
	pn[0] = 1;
	num[0] = 2;
	s[0] = 1;
	int minm, mins;
	while(num[n] < d)
	{
		for(int i = n; i < n; i ++)
			for(int j = 0; j < pn[i]; j ++)
			{
				if(s[i] / a[i][j] * a[i][j])
			}
	}
	//cout << s << endl;

	int total = 0;

	cout << "Between " << l <<  " and " << d << " , " <<  << " has a maximum of " <<  <<  " divisors."<< endl;

	return 0;
}*/
#include "ptoc.h"


static const char fin[] = "divisors.in";
static const char fon[] = "divisors.out";
enum { maxprime = 31622,                          /*质数上限*/
amount = 3401};                                  /*质数个数*/
word primes[amount];                         /*质数表*/
longint l,                                           /*下界*/
u,                                           /*上界*/
number;                                      /*保存当前含因数最多的数*/
word max;                                        /*因数个数*/
void getprimes()                                 /*求质数过程（筛法）*/
{
    boolean get_[maxprime-2+1];
     word i, j;

   fillchar(get_, sizeof_(get_), 1);
   for( i = 2; i <= maxprime; i ++)
     if (get_[i-(2)])
            {
              j = i + i;
              while (j <= maxprime) 
                {
                  get_[j-(2)] = false;
                  j += i;
                }
            }
   j = 0;
   for( i = 2; i <= maxprime; i ++)
     if (get_[i-(2)])
            {
              j += 1;
              primes[j-(1)] = i;
            }
}
void try_(word from, word tot, longint num, longint low, longint up)
                                                 /*搜索过程：
                                                    from： 当年枚举的质因数
                                                    tot： 当前质因数个数
                                                    num： 当前数(number)
                                                    low： 当前下界
                                                    up：   当前上界
                                                 */
{
    longint x, y, n, m;
     word i, j, t;

   if (num >= l)                                   /*判断number是否在[l,u]区间内*/
          if ((tot > max) || ((tot == max) && (num < number)))
                 {                               /*判断number是否优于当前最优解*/
                   max = tot;
                   number = num;                 /*更新当前最优解*/
                 }
   if ((num < up) && ((cardinal)(tot + 1) > max))  max = tot + 1;
                                                 /*判断并处理包含大质因数的数*/
   for( i = from; i <= amount; i ++)                    /*枚举质因子*/
     if (primes[i-(1)] > up)
            exit;
       else {
              j = primes[i-(1)];
              x = low - 1; y = up; n = num; t = tot; m = 1;
                                                 /*初始化*/
              while (true) 
                {                                /*枚举质因子个数*/
                  m += 1; t += tot;
                  x = x / j; y = y / j;
                  if (x == y)  flush(input);
                  n = n * j;
                  try_(i + 1, t, n, x + 1, y);     /*搜索下一层*/
                }
              if (tot < max + m)  exit;        /*剪枝*/
            }
}
int main(int argc, const char* argv[])
{
pio_initialize(argc, argv);
assign(input, fin); reset(input, 0, 0, 0);
assign(output, fon); rewrite(output, 0, 0, 0);
getprimes();                                     /*初始化，求出质数表*/
cread("%?%?\n", &l, &u);                                  /*读入下界和上界*/
if ((l == 1) && (u == 1))                         /*判断特例*/
         {
           max = 1;
           number = 1;
         }
    else {
           max = 2; number = l;                  /*初始化*/
           try_(1, 1, 1, l, u);                    /*搜索*/
         }
cwrite("Between %? and %?, %? has a maximum of %i divisors.\n", l, u, number, max);
                                                 /*输出*/
close(output); close(input);
return EXIT_SUCCESS;
}